package com.neuedu.corejava.ch6.homework;

public class Rectangle {
	double length;
	double width;
	
	public Rectangle(double length, double width) {
		super();
		this.length = length;
		this.width = width;
	}
	
	public double getArea(double length, double width){
		return this.length* this.width;
	}
		
	public double getPer(double length, double width){
		return 2 * (this.length+ this.width);
	}

	public void showAll(double length, double width){
		System.out.printf("长方形的长为:%3.3f,宽为3.3f\n",this.length,this.width);
		System.out.printf("长方形的面积为:%3.3f\n", getArea(length, width));
		System.out.printf("长方形的周长为:%3.3f\n", getArea(length, width));	
	}

}
